# -*- coding: utf-8 -*-

import gnupg
gpg = gnupg.GPG(gnupghome="/home/joger/.tibisay/gpg")
#publica = gpg.export_keys('jogerq@gmail.com')
#privada = gpg.export_keys('jogerq@gmail.com',True)

#f = open("/home/joger/Escritorio/llave.txt","r")
#f.write(publica)
#f.write(privada)
#export_result = gpg.export_keys("jogerq@gmail.com")
#if export_result:
#    print 'Fino'
#f.close()
#print import_result.count
l = gpg.list_keys() #Lista las claves
print l



#for x in l:
#    print x
#    print "******************"

"""
Name-Real:
Name-Email:
Passphrase:
Key-Type: DSA, RSA
Key-Length: 2048
Subkey-Type: ELG-E,RSA
Subkey-Length: 2048
Name-Comment: Comentario
Expire-Date: "2009-12-31", "365d", "3m", "6w", "5y", "seconds=<epoch>", 0

"""
"""

###Generar la llave pública y privada

params = {'Key-Type': 'DSA','Key-Length': 1024,'Subkey-Type': 'ELG-E',
          'Subkey-Length': 2048,'Name-Comment': 'Ros','Expire-Date': 0,
         }

first_name = "Ross"
last_name = "Sumoza"
params['Name-Real'] = '%s %s' % (first_name, last_name)
params['Name-Email'] = "rossara@yahoo.com"
params['Passphrase'] = "12345678"

params = {'Name-Comment': 'LL', 'Key-Type': 'DSA', 'Name-Real': 'j', 'Expire-Date': 0, 'Passphrase': '1', 'Subkey-Type': 'ELG-E', 'Name-Email': 'jogerq@gmail.com', 'Key-Length': '2048', 'Subkey-Length': '2048'}
input_key = gpg.gen_key_input(**params)
keys = gpg.gen_key(input_key)

print keys
"""

